<template>
  <component :is="currentComponent" />
</template>

<script>
import NewsDetail from './NewsDetail.vue'
import ResultDetail from './ResultDetail.vue'

export default {
  name: 'NewsDetailWrapper',
  components: {
    NewsDetail,
    ResultDetail
  },
  computed: {
    currentComponent() {
      const type = this.$route.query.type
      if (type === 'result') {
        return 'ResultDetail'
      }
      return 'NewsDetail'
    }
  }
}
</script>

